﻿namespace UnityEditor
{
    using System;
    using UnityEngine;

    [Serializable]
    public sealed class ModelImporterClipAnimation
    {
        private float m_CycleOffset;
        private float m_FirstFrame;
        private int m_HeightFromFeet;
        private int m_KeepAdditionalBonesAnimation;
        private int m_KeepOriginalOrientation;
        private int m_KeepOriginalPositionXZ;
        private int m_KeepOriginalPositionY;
        private float m_LastFrame;
        private float m_Level;
        private int m_Loop;
        private int m_LoopBlend;
        private int m_LoopBlendOrientation;
        private int m_LoopBlendPositionXZ;
        private int m_LoopBlendPositionY;
        private int m_Mirror;
        private string m_Name;
        private float m_OrientationOffsetY;
        private string m_TakeName;
        private int m_WrapMode;

        public override bool Equals(object o)
        {
            ModelImporterClipAnimation animation = o as ModelImporterClipAnimation;
            return ((((((animation != null) && (this.takeName == animation.takeName)) && ((this.name == animation.name) && (this.firstFrame == animation.firstFrame))) && (((this.lastFrame == animation.lastFrame) && (this.m_WrapMode == animation.m_WrapMode)) && ((this.m_Loop == animation.m_Loop) && (this.loopPose == animation.loopPose)))) && (((this.lockRootRotation == animation.lockRootRotation) && (this.lockRootHeightY == animation.lockRootHeightY)) && (this.lockRootPositionXZ == animation.lockRootPositionXZ))) && (this.mirror == animation.mirror));
        }

        public override int GetHashCode()
        {
            return this.name.GetHashCode();
        }

        public float cycleOffset
        {
            get
            {
                return this.m_CycleOffset;
            }
            set
            {
                this.m_CycleOffset = value;
            }
        }

        public float firstFrame
        {
            get
            {
                return this.m_FirstFrame;
            }
            set
            {
                this.m_FirstFrame = value;
            }
        }

        public bool heightFromFeet
        {
            get
            {
                return (this.m_HeightFromFeet != 0);
            }
            set
            {
                this.m_HeightFromFeet = !value ? 0 : 1;
            }
        }

        public float heightOffset
        {
            get
            {
                return this.m_Level;
            }
            set
            {
                this.m_Level = value;
            }
        }

        public bool keepAdditionalBonesAnimation
        {
            get
            {
                return (this.m_KeepAdditionalBonesAnimation != 0);
            }
            set
            {
                this.m_KeepAdditionalBonesAnimation = !value ? 0 : 1;
            }
        }

        public bool keepOriginalOrientation
        {
            get
            {
                return (this.m_KeepOriginalOrientation != 0);
            }
            set
            {
                this.m_KeepOriginalOrientation = !value ? 0 : 1;
            }
        }

        public bool keepOriginalPositionXZ
        {
            get
            {
                return (this.m_KeepOriginalPositionXZ != 0);
            }
            set
            {
                this.m_KeepOriginalPositionXZ = !value ? 0 : 1;
            }
        }

        public bool keepOriginalPositionY
        {
            get
            {
                return (this.m_KeepOriginalPositionY != 0);
            }
            set
            {
                this.m_KeepOriginalPositionY = !value ? 0 : 1;
            }
        }

        public float lastFrame
        {
            get
            {
                return this.m_LastFrame;
            }
            set
            {
                this.m_LastFrame = value;
            }
        }

        public bool lockRootHeightY
        {
            get
            {
                return (this.m_LoopBlendPositionY != 0);
            }
            set
            {
                this.m_LoopBlendPositionY = !value ? 0 : 1;
            }
        }

        public bool lockRootPositionXZ
        {
            get
            {
                return (this.m_LoopBlendPositionXZ != 0);
            }
            set
            {
                this.m_LoopBlendPositionXZ = !value ? 0 : 1;
            }
        }

        public bool lockRootRotation
        {
            get
            {
                return (this.m_LoopBlendOrientation != 0);
            }
            set
            {
                this.m_LoopBlendOrientation = !value ? 0 : 1;
            }
        }

        public bool loop
        {
            get
            {
                return (this.m_Loop != 0);
            }
            set
            {
                this.m_Loop = !value ? 0 : 1;
            }
        }

        public bool loopPose
        {
            get
            {
                return (this.m_LoopBlend != 0);
            }
            set
            {
                this.m_LoopBlend = !value ? 0 : 1;
            }
        }

        public bool mirror
        {
            get
            {
                return (this.m_Mirror != 0);
            }
            set
            {
                this.m_Mirror = !value ? 0 : 1;
            }
        }

        public string name
        {
            get
            {
                return this.m_Name;
            }
            set
            {
                this.m_Name = value;
            }
        }

        public float rotationOffset
        {
            get
            {
                return this.m_OrientationOffsetY;
            }
            set
            {
                this.m_OrientationOffsetY = value;
            }
        }

        public string takeName
        {
            get
            {
                return this.m_TakeName;
            }
            set
            {
                this.m_TakeName = value;
            }
        }

        public WrapMode wrapMode
        {
            get
            {
                return (WrapMode) this.m_WrapMode;
            }
            set
            {
                this.m_WrapMode = (int) value;
            }
        }
    }
}

